The present invention relates to recording and playing of sound data, and particularly to a recording and play technique that reduces a processing load at the time of playing back sound data having a loop part.
In an information processing apparatus having a digital sound data play function, such as a personal computer, a game machine, a music play apparatus or the like, coded sound data are converted into analog sound data before sound output at the time of playing.
Some coded sound data, such as data of a music CD, are non-compressed. However, in many cases, sound data are read in a compressed state, and at the time of playing, expanded and outputted as sound.
Various sound compression methods have been proposed and practically used. Widely known is a method in which time series sample data are divided into a plurality of blocks, and an orthogonal transform such as DCT (Discrete Cosine Transform) or MDCT (Modified Discrete Cosine Transform) is applied to those blocks to obtain compressed data. In that case, to increase continuity of sound waveforms, compression is sequentially performed in groups of adjacent blocks, while making each group overlap with the next one in a block. As a representative of such compression methods, may be mentioned ATRAC (Adaptive TRans form Acoustic Coding) employed by a so-called mini disc (MD) and the like (See Patent Document 1).
FIG. 3 is a diagram showing compression of sound data in blocks. In the figure, time series sample data are divided into blocks (original blocks) A, B, C, D, E, . . . , each consisting of predetermined pieces of data.
Then, compression is performed in groups of two consecutive blocks, with each group overlapping the next group in one block, to generate encoded blocks. Here, no sound data exists before the start position (DS) of the sound data, and accordingly, there is no block to be paired with the block A. Thus, a block A0 consisting of dummy data such as silence data is added to be paired with the block A. Similarly, no sound data exists after the end position (not shown) of the sound data, and accordingly, there is no block to be paired with the last block. Thus, a block consisting of dummy data such as silence data is added to be paired with the last block.
Then, in this example, encoded data X1 are generated from the original blocks A0 and A, and encoded data X2 from the original blocks A and B.
At the time of playing the sound data, a decoded block a is generated from the encoded blocks X1 and X2. Then, the samples of the decoded block a are subjected to D/A conversion to reproduce the sound. In the same way, decoded blocks b, c, . . . can be obtained, and thus, the sound is reproduced continuously. Here, FIG. 3(d) shows the decoded blocks in the case where audio codec delay occurs at the time of encoding and decoding. As shown in the figure, output positions of the decoded data are shifted by the size of the audio codec delay.
Patent Document 1: Japanese Non-examined Patent Laid-Open No. 8-287612
Sometimes, sound data include a loop part (a repeat part). For example, as shown in FIG. 3(a), there is a case where sound ranging from a prescribed position (LS) to another prescribed position (LE) of sample data is repeated until a certain condition is satisfied. Here, it is assumed that the start position LS of the loop is included in the original block A and the end position LE of the loop is included in the original block D.
At the time of playing in that case, as shown in FIG. 4, when playing is performed down to the position corresponding to LE in the decoded block d, then, playing is performed from the position corresponding to LS in the decoded block a. Here, FIG. 4 shows the decoded blocks in the case where audio codec delay occurs at the time of encoding and decoding. As shown in the figure, output positions are shifted backward by the size of the audio codec delay.
Conventionally, sound data having a loop part are played as described above. However, when such a method is employed, sometimes sound is disturbed at the loop part.
Thus, an object of the present invention is to improve tone quality at the time of playing sound data having a loop part.